package com.abc.cloud.dao;

import com.abc.cloud.dto.perms.PermsCategory;
import com.abc.cloud.entity.PermsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 权限表
 * 
 * @author LiJunXi
 * @email 2770063826@qq.com
 * @date 2023-11-05 10:18:14
 */
@Mapper
public interface PermsDao extends BaseMapper<PermsEntity> {

    List<String> queryUserPermsList(Long userId);

    @Select("select * from tb_perms_category")
    List<PermsCategory> selectPermsCategoryList();

    @Insert("insert into tb_perms_category (id, perms_name) value (#{id}, #{name})")
    int savePermsCategory(PermsEntity permsEntity);

    @Select("select * from tb_perms_category where id = #{id}")
    PermsEntity selectPermsCategoryById(Long id);
}
